//
//  NextCollectionViewCell.m
//  Ting
//
//  Created by 安静的美男子 on 14/11/12.
//  Copyright (c) 2014年 安静的美男子. All rights reserved.
//

#import "NextCollectionViewCell.h"
@implementation NextCollectionViewCell
-(instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
        
        
        
        self.photo = [[UIImageView alloc]initWithFrame:CGRectMake(5, 5, self.contentView.bounds.size.width - 10, self.contentView.bounds.size.height - 20 - 5)];
        

        [self.contentView addSubview:_photo];
        self.title = [[UILabel alloc]initWithFrame:CGRectMake(5, _photo.frame.size.height + 5, _photo.frame.size.width, 20)];
        
        _photo.layer.shadowColor = [UIColor lightGrayColor].CGColor;
        _photo.layer.shadowOpacity = 2;
        _photo.layer.shadowOffset = CGSizeMake(5, 5);
        self.title.textAlignment = NSTextAlignmentCenter;
        self.title.font = [UIFont systemFontOfSize:15];
        [self.contentView addSubview:_title];

    }
    return self;
}
-(void)setModel:(NextModel *)model num:(NSInteger)num
{
    [self.photo sd_setImageWithURL:[NSURL URLWithString:[model.list[num] objectForKey:@"cover_path"]] placeholderImage:[UIImage imageNamed:@"123.gif"]];
    self.title.text = [model.list[num] objectForKey:@"tname"];
    
}
@end
